package easy;

public class Solution_1688 {

    public int numberOfMatches(int n) {
        int count = 0;
        while (n>=2) {
            if (n%2==0) {
                n>>=1;
                count += n;
            } else {
                n>>=1;
                count += n;
                n++;
            }
        }
        return count;
    }

    public static void main(String[] args) {
        Solution_1688 model = new Solution_1688();
    }
}
